Everything is translated.
What you describe is actually a common problem in translation, especially when dealing with artificial or unspecified source languages. The original word cannot be exactly translated, because there is no exact equivalent in the target language, and the original from the source language cannot be used without breaking immersion because it would require explanation as to what it is, be that by modifying the prose or by adding a footnote with an explanation.
In some cases that disruption is considered acceptable. For example, the comprehensive English translations I have of 西遊記 (Journey to the West) and El Ingenioso Hidalgo don Quixote de la Mancha both have numerous examples of use of original terms or direct translations of original terms with associated footnotes explaining them in context. This makes sense for those particular translations of those books, as they are intended to be translations for students of linguistics and historical literature and not simply telling a story.
However, for cases like what Tolkien is trying for with his various works about Middle Earth though, the goal is to tell the story, so he ‘translates’ with the intent to preserve understanding, not exact meaning. So instead of using original wording (and having to invent such words) and then explaining it, he just picks words that convey a meaning that would be intuitively understood by his target audience.
Given that some of the early iterations were stories for his children, the use of ‘jack-in-the-box’ as part of an idiom talking about unexpected guests actually makes a lot of sense. We can infer that either something similar did exist in Middle Earth (clockwork did exist, because clocks precise enough to track time down to the minute existed, and a jack-in-the-box needs only very rudimentary clockwork), or that some other idiom is being used in the source language which would not make sense to those the translation is being made for.
This is generally known as idiomatic translation, and it is very common. In fact, outside of purely academic or technical settings, this type of translation is the norm because literal translation often results in nonsensical sounding phrasing in the target language, or simply cannot be done without losing some meaning or using a huge number of extra words. The Wikipedia page on untranslatability has some good examples for translating to English, but also see things such as the Swedish ‘fika’, Hebrew ‘פירגון’ (firgun), Japanese ‘粋’ (iki), or Sanskrit ‘Dharma’.