There are lots of factors that make a class harder or easier to teach, and it's not as simple as just numbers or even mixed year groups.
Spread of ability - whether that be within a year group or across >1 - is a significant factor. Teaching a class where the least able is working at or just below reception level and the most able is easily capable of KS3 work (entirely possible in a standard single year KS2 class) is more difficult than teaching a mixed age group class with no / few outliers, so e.g. a Y4/Y5 class where the 'effective ability' ranges between Y3 and Y6.
Mixed year groups - the Maths curriculum in particular is year group specific, so this does make mixed classes harder to plan for. This is particularly difficult across key stages (Y2/Y3 mixed classes and R/Y1 classes). School arrangements can make this harder or easier - it is harder in a school where e.g. there is a pure Y4, a pure y5 and a mixed Y4/Y5, or a Y4/Y5 and a Y5/Y6, to ensure that all Y5 pupils have a similar experience and topics etc don't get repeated.
Numbers - to be honest this matters less within the class itself, but the difference really makes itself felt when it comes to marking!
SEN - as well as making a difference to the ability spread, children with SEN come with significant extra planning and paperwork needs (rightly) as well as adaptations, interventions, sometimes an additional adult etc. These add to workload, and as there is only so much time, it does mean that time for each other child is spread more thinly.
School / colleagues - some schools are easier to work in than others, and the way schools are arranged can make a huge difference. Schools where a lot of the work is 'social work' - lots of TAF meetings, significnt social work involvement, lots of family support, lots of child protection - have time and worry commitments over and above the simple teaching. Equally, schools with multiple classes per year group can ease the planning load while redicing flexibility and imposing additional bureaucratic burdens on occasion.
Behaviour - a well-behaved class of 36 can be easier to teach than a class of 25 where there are children with specific behavioural issues, and again time taken dealing with behaviour means time away from teaching others.