Due to just how amazingly awesome aerodynamic design development, materials science and aeropropulsion systems have gotten, some airliners can stay in the air for about a day on one tank of gas and fly halfway around the world. This is both great for the passengers, because it gets them their pretty quickly (compared the travel during the other 99.9% of human history) for a reasonable fee; and it sucks, because the passengers are jammed into too-small seats for nearly a full day. But you know who else is on the plane the whole time? The crew. And unlike the passengers, they have *got* to get some sort of adequate rest during the flight.
In order to make sure that the flight crew isn’t either dead on their feet or hopped up on amphetamines during landing, the larger jetliners have sleeping areas for the crew, usually above but sometimes below the passenger cabin.
You will occasionally see click-bait headlines yammering on about the “secret rooms on jetliners you never knew about” or some such (the YouTube videos below dabble in this), even though these rooms are not secret, and a great many people know about them. Sure, the airlines don’t exactly advertise the things… but why would they? If the full load of passengers were fully and actively aware that there are actual *beds* on airplanes, you can bet that on every trans-Pacific flight there’d be at least one drunken businessman belligerently trying to storm the castle.