The word "camera" means "room" in Italian. Originally, cameras were referred to as "Camera Obscura" or "Room Dark".
Cameras were first used by painters - literally as rooms. They would construct light tight sheds and would put a small hole in one side. This hole projected an image of the scene outside onto the opposite wall, which they could then trace for reference. A lens would focus the image and make it brighter, but was by no means necessary. A small hole is actually a type of lens and a camera, just a dark room.
The image that appears is upside down and backwards - because light travels in straight lines - and so as it enters the small hole or lens, it ends up flipped on the other end of the room, or camera.
Try it with an oatmeal box. Cut a small square hole in the middle of one side, cover the hole with a piece of foil and put a small pinhole in the foil. Take it outside and look through the top of the box, shielding your eyes from outside light. You will see an image on the inside of the box. (Putting a piece of bright white paper inside the box helps.)