There are several types of 3D.
The basics:
The oldest type dates back about a hundred years and was/is called stereoscopic
Typically, the camera had two lenses that are separated by about 3 inches.
When you took the picture it captured two pictures, one from each lens.
It produced two images on one piece of film.
A print was made and put into a viewer for viewing.
Your left eye only saw the left picture and the right eye only saw the right picture.
Similar to that is the stereo for cross-eyed viewing.
You switch the right and left sides and make a print.
You then view the images by crossing your eyes and you don't need any type of viewer.
A bit tricky to do.
The type you see in the movies is where they merge two images into one image.
Then you need special glasses to separate the two images to your eyes.
This method can be used for still pictures too.
2D of course is the standard camera with one lens.
But there are many ways you can produce two images from a 2D camera.
The simplest being to take one picture and move the camera to one side and take another picture.
With software you put them side by side or merge them into one image.
The problem with this method is that you cannot permit any movement in the scene between shots.
That means action shots can not be done that way.
Of course there are beam splitters (prisms) that can capture two pictures from one lens.
..