How to make a wooden box with a hidden lid
The trick here is to actually have the lid start out as part of the box, so that the grain of the wood all runs right across the separation between box and lid.

One way this can be accomplished is to build a solid "block", and then turn that into a box.  You first cut off a "lid" off of the solid block, and then by one means or another, hollow out the inside of the box part.

Then you would often use a belt sander or just sand paper on a flat surface and tidy up the two mating pieces (lid and box lip) so that imperfections from the sawing go away and leave an imperceptible gap between the lid and the box.

Since the lid "came from" the box originally, it will all match up and look like a single piece of wood if you get your gap perfect enough.

To better understand the techniques, search on YouTube for "bandsaw box".  It is a "thing" in the woodworking community.  Some people specialize in making small boxes similar to what you've described but for decorative rather than deceptive use.