Both lens and body, but also the sport and the camera setting.
As other have said, some cameras focus better and faster.
New cameras have a higher High ISO, which helps tremendously with sports.
A FASTER lens, give more light to the camera's autofocus system. That extra light, will help make the camera focus faster and more accurately.
If the gym is not well lit, which many school gyms are not, the camera may struggle to focus.
I shoot volleyball at my high school with a 35/1.8 and 50/1.8 lens, and basketball with the 35/1.8 lens. I got these lenses specifically to deal with the low light level in the gym. I shoot at ISO 3200, 1/800 sec, f/2.
The faster lens also helps the cameras autofocus to focus easier and faster.
I shoot on the floor or from the first row of the bleachers. So I am close to the players, and I don't need a long lens.
The sport is also an issue.
Very common for me in volleyball is to have to QUICKLY shift from player-1 to player-2. When I shoot a burst, odds are that frame 1 will be out of focus, because the lens is still focusing on player-2 when the shutter fires. Then from frame 2 and on, player-2 is in focus. The greater the distance change from player-1 to player-2, the more likely that frame 1 will be out of focus.
As you become more familiar with the sport, you will be able to predict where the ball will go, and be able to aim the camera at that player just a little bit faster, so that the autofocus has a little bit more time to get the lens focused.
This year is my third year shooting volleyball, and I am finding it not as difficult as it was in prior years. In many cases, I am able to predict who will get the ball, and start moving my camera to that player, just a little bit faster than I used to.
The camera setting issue is, what exposure mode and autofocus setting you have the camera set up to use.
For most high school sports, I use
- One of the PSAM modes, in my case usually M. I never use Auto.
- PSAM lets ME choose what to focus on.
- Auto uses "closest subject" logic. This problem is discussed below.
- The problem in team sports is that there will likely be other players near your daughter. The camera is not smart enough to know who your daughter is, vs. the other players.
- "single point" autofocus allows ME to choose exactly who to focus on. So I can select a specific player to focus on.
- Area/zone autofocus usually uses "closest subject" logic. This is where the camera will find the closest subject within the focus area, and focus on that subject. And in a multi-player sport, odds are it won't be your daughter.
- Example, in volleyball, if I am trying to shoot the forward on the far side of the court, there are two players between me and that player. In area autofocus, the camera will focus on the closest of those two players.
- Area autofocus means that the camera has to spend time determining which is the closest subject, before it can even begin to start focusing the lens. It is a small amount of time, but it cuts into the little time you have, when you switch subjects quickly.
- But, by shooting in single point autofocus, this then places ALL the responsibility to track the subject on YOU.