Depth of field
Simulator
With the framing held, changing the focal length moves the camera too. Watch how little the depth of field changes when you do.
What is sharp, and how much of it
Only one distance is ever truly in focus. Either side of it there is a zone that looks sharp enough, and four things decide how deep that zone is, and one of them is not what most people think.
The circle of confusion
A point either side of the focus lands on the sensor as a small disc. While that disc is smaller than the detail the format can resolve, it still looks like a point. Depth of field is just the range of distances where that is true.
Aperture is the obvious control
The f-number sets the width of the cone of light, and the width of the cone sets how fast the disc grows. Every stop you close roughly halves the rate, which is why stopping down buys depth so reliably.
Distance matters more than anything
Depth of field grows roughly with the square of the subject distance. Double the distance and you have about four times the depth, which is why a wide shot holds focus and a close-up does not, on any lens.
Focal length barely matters, at the same framing
A long lens has less depth than a wide one from the same spot. Move back until the subject is the same size in frame and the difference very nearly disappears. It is the magnification that sets the depth, and focal length only changes the magnification.
Sensor size works through the same rule
A bigger sensor needs a longer lens for the same framing, and a longer lens from the same distance has less depth. That is the whole of why large format looks shallower. Nothing about the sensor itself defocuses anything.
Hyperfocal is the other end of it
Focus at the hyperfocal distance and everything from half of it to infinity is sharp. It is the most depth that aperture can buy you, and focusing any further away simply throws the near half away.