Let's get right to the chase: two primary autofocus systems exist, contrast-based and phase detection. DSLRs use phase detection as their primary autofocus capability, while compact cameras use contrast as their sole autofocus capability. Mirrorless cameras can be either (and in some cases, both).
- DSLRs — one of the uses of the mirror contained in the traditional DSLR is that it splits off some light to a phase detect sensor. Phase detect sensors are interesting, because they can report not only which direction the focus is off (near/far) but also by how much. Thus, in a phase detect system, the camera looks at the focus sensor, sees direction/distance and tells the lens to "move there." It's very quick, and capable of following movement very easily. Because DSLRs have large autofocus sensor modules, they have quite a bit of finite discrimination, meaning that they’re better at telling the difference between very small distance changes. Because mirrorless cameras do phase detect on the sensor, the geometries involved are far smaller, and they tend to have less finite discrimination.
- Compacts — (most) compact cameras use the imaging sensor for everything. They look at the image and measure contrast. At the most simplistic level, high contrast means "in focus" and low contrast means "out of focus." Most contrast-based sensor systems have no notion of direction and distance the lens needs to move to improve contrast, so the camera iterates: the camera moves the focus a bit and re-evaluates, then uses that information to tell the lens more about where to go. You’ll often see contrast systems do an over-and-back move at the end, where they go past maximum contrast, then return back to the previous highest contract point detected. Panasonic’s contrast detect system—indicated by the DFD label—is unique in that it uses information about what out of focus looks like for each lens at different distances as a hint as to where and how much to move.
Phase detect sensors often operate with very high data streams (usually higher in a pro DSLR than in a consumer or mirrorless one, which is why the pro DSLRs tend to be better at focus on fast moving subjects). Contrast-based systems operate at (usually) the video frame rate of the camera, which is generally slower, though the tendency has been to up this rate in recent years.
Mirrorless cameras are an interesting crossbreed, because we're seeing both types of systems evolve and get pushed in new directions. For example:
- Canon M/RF/RF-S use what Canon calls dual pixel capability: Every photosite on the image sensor is capable of providing phase detect focus information to the camera's electronics.
- Fujifilm X, Nikon 1 and Z, Panasonic S, and Sony A use rows of phase detect sensing: Each uses a slightly different approach, but they are all similar in that they use entire lines of photosites, but skip lines.
- OMDS OM-1 and OM-5: Dedicate a small number of photosites to cross pattern phase detect, and remap pixels around those areas.
- Most other (and older) models: Other cameras use contrast-detect focus, and pushed three things that were different into their mirrorless cameras compared to their compacts: (1) faster imaging frame rates for focus (now at least 120 fps and as fast as 240 fps); (2) faster lens focus motors; and (3) more sophisticated check-and-jump focus algorithms.
There's strong demand for mirrorless systems to have focus performance more like DSLRs than compact cameras, thus there's a lot of R&D tackling the problem, and focus performance has improved tremendously in the ten+ years we’ve had mirrorless cameras. The m4/3 cameras were better than we were used to from contrast-based focus systems in compact cameras when they first appeared, and have gotten better with each subsequent generation.
The many phase-detect-on-sensor systems now appearing on mirrorless cameras are highly variable in nature. The Sony A7 Mark II generation is okay, but not close to DSLR performance, though the Mark III/IV generation are faster and much, much closer to DSLR performance. The Sony A1 exceeds most DSLR performance. You see similar things in the Nikon lineup: Z5 to Z7 come close to DSLR performance, the Z9 exceeds it. In order of performance, I’d call it this way from best autofocus performance to worst right now:
- Canon R3, Nikon Z8/Z9, Sony A1/A9 Mark III. Clearly the best performing current focus systems, matching or besting a DSLR in every aspect.
- Sony A9 Mark I/II and A7 Mark III/IV models, Canon R5/R6/R7, and Nikon Z6 II/Z7 II/Zf. Truly solid autofocus performance when mastered. Top DSLR-level abilities in many respects.
- Everything else. Tends to fall somewhere below the above at varying levels.
Where we stand today is here: almost all mirrorless cameras have focus performance close to or exceeding DSLRs, and the average is now much closer to top DSLR-level performance.
Overall, here's how I'd characterize focus performance for mirrorless cameras today:
- Static subjects — Anywhere from excellent to superb, and generally better than DSLRs. Face and eye recognition routines can make these systems really good for automatic use on human or animal subjects (just point the camera and let it figure out where focus should be).
- Moving subjects — Only the better mirrorless cameras match or exceed top DSLR performance, though many current models are as capable as many DSLRs. As noted above, the best performance in mirrorless is at the top of the lineups: Canon R3, Nikon Z9, and Sony A1. Set and handled properly, most current mirrorless cameras are usable for many continuously moving subjects and produce good results, while the best probably will exceed what you got from DSLRs.
Autofocus performance for mirrorless will continue to change (for the better) over time. Today the mirrorless cameras are between compacts and DSLRs in autofocus performance, but almost all get relatively close to the consumer DSLRs, and a few get close to the high-end DSLRs. Expect better autofocus performance than your compact camera had (at least from the leading mirrorless cameras), but expect worse than your high-end DSLR.