There can be good reasons to prioritize working on animal welfare above working on human welfare, even if you prioritize human welfare above animal welfare on a "per individual" basis.
Due to comparative advantage, it can sometimes be sensible to work on a problem that is not the most important problem, if you are a better fit for it. For example, if you are particularly skilled at helping animals or particularly motivated to do so, you may be able to help them more than you can help humans.
Moreover, different problems intrinsically have different "yield per unit effort". For example, farm animal welfare generally is a cause that receives startlingly little attention, given the huge numbers of farmed animals in existence and often poor conditions that they live in. Here's a visualization:
(source: Animal Charity Evaluators)
This means that there's often very low-hanging fruit in opportunities to improve the welfare of farm animals, and that means it can be extremely low-cost to make progress, relative to how much it costs to help humans. Even if you believe one human life is worth N (> 1) animal lives, you may find that you can save more than N animals with the same money (or time or work or etc.) it would take to save one human.
All that aside though, I doubt any of this is the explicit justification most people use when choosing a career helping animals. If you're confused about why people do that, I will say two things:
- Most people don't make ethical priorities the primary driver of their career choices. They choose based on what they'd enjoy, what they're good at, what ensures their financial security, and so on. While ethics is often a part of why people choose the job they have, it's generally not their goal to choose the most ethical career available.
- Even when people do make ethics the central concern in their career choices, most people don't conduct explicit prioritization in their ethical choices – people are generally hesitant to say "this way of helping is more important than that one", or (seemingly) it doesn't even occur to them to ask the question at all. I wish I understood more about why this is, but in part I'm sure it's just that prioritization in any sphere is hard: people make bad decisions, or at least sub-optimal ones, in all parts of life, because it's difficult to really thoroughly survey all the available options, their costs and benefits, and to follow where the reasoning leads you, instead of where you instinctively desired to go.
I've taken a lot of interest in effective altruism in more recent years as a better way to answer questions like these. Note that "animals vs. humans" is, in that context, just one of many prioritization decisions you need to make: consider humans in the developed world vs. those in the developing world, humans currently alive vs. humans yet to be born, saving humans from death vs. preventing their suffering vs. improving their economic, social or political freedoms. There's a lot to take in here, a lot to consider. It's a huge challenge, as you'd expect, but certainly some progress has already been made, and there's more yet to make :)