The DfE funds academies and free schools directly. These schools receive fewer services from their LA than other types of school. They get higher funding per pupil to compensate for this.
Other types of school are funded by their LA. The LA receives a Dedicated Schools Grant and the Pupil Premium from the DfE. The DSG depends on the number of children attending schools in the LA. The amount per child varies from LA to LA depending on a number of factors. The Pupil Premium is more straightforward - £600 for each pupil receiving free school meals.
The LA deducts from these grants an amount to fund the central services they provide to schools. This deduction varies from LA to LA. This is partly down to the level of services offered but also some LAs are more efficient than others. The remainder is then distributed to schools. How it is distributed depends on the LA. Most take into account a variety of factors in determining how much each school receives so, although the number of pupils is the primary factor in determining funding, it is not the only factor.
The other thing to remember is that the financial year runs from April to March. Funding is determined by the number of children the school has on the roll in January, 3 months before the start of the financial year. That may be more or less than the average number of pupils during the financial year. If, for example, the school receives, say, £4000 per pupil and has 300 pupils on the roll in January it will receive £1.2M funding. If the average number of pupils in the financial year is actually 320 this will equate to funding of £3750 per pupil. On the other hand, if the average number of pupils in the financial year is actually 280 the school will still receive £1.2M - around £4285 per pupil.
Some counties do it by multiples of 30 children, so 30 kids gets you money for 1 teacher (very simplified!) but 31 gets you funding for 2 teachers, but they would prob have 1 class so benefit more than a school with 60 children who also get the same money. Also they may pay a additional fee if the teachers are experienced I.e. more expensive. They may also have a guarantee to keep open small rural schools that are isolated even if they have very few pupils. I used to work in Somerset until about 2.5 yrs ago, primary per pupil funding ranged from my middle school being the worst funded with a coup,e of thousand per pupil to small rural primaries getting well over 10k per child.
Funding also was affected by experiancredit scoring data for the catchment area of the school to assess the deprevation or not in an area.