If you use top end organic butter, eggs etc then yes it's very pricey. I use free range eggs at £1 for six, I use Stork instead of butter, and I manage to get McDougalls flour at £1 per 1.5kg bag, and there's cheaper brands about. But the other big issue is fuel - I only ever bake big cakes if the oven is already planned to be on. Doing all of this I reckon I can get a basic two tier 8" vanilla sponge from an 8, 8, 8, 4 mixture for about £2, any icings/fillings are possibly 50p ish extra. It'll serve the four of us at least twice. If I'm doing birthday cakes for the boys I've mostly just hired shaped number tins from our local cook shop (£2.50 per day), do the same basic sponge, iced with a standard icing sugar pour over (sometimes coloured), and I stud them with smarties or jelly beans - they've always loved them, and I can usually do one serving 20 ish kiddy portions for about £5. Alternatively I do coloured ready roll icing with biscuit cutter shapes in contrast colours on top - I did a large bowling pin cake for 7yo ds1 this year for well under a tenner.
But yes, it's not always cheaper to bake stuff from scratch at all, expecially when you can buy 400g packs of biscuits for 20p-25p in most supermarkets these days. Same as jam - I love making my own jam, and the taste is incomparable to shop bought, but it's never cheaper even when the fruit is hedgerow and free in the autumn. The amount of sugar and fuel needed means it's always more expensive than cheap shop bought.