If a guitar with 24 frets has the same scale length as a 22 fret model, are all the frets made smaller to fit the extra 2 in or it just just an extra piece of wood at the end of the fretboard?
no. The neck is just longer. Consequently, they push back the neck pickup closer to the bridge. I like the tone like that, but a lot of people hate it.
Jackson RR5 ivory w/ EMG 81/85
Jackson DX6 w/ SD Distortion & Dimarzio Super Distortion
Fender Starcaster Sunburst
Mesa/Boogie DC-3
Johnson JT50 Mirage
Ibanez TS-9
Morley Bad Horsie 2
Boss CE-5

ISP Decimator
Boss DD-6
Korg Pitchblack
Generally 24 fret guitars either have extra jumbo or jumbo frets and are 25.5" scale.

If they are 24.75" scale, the neck pickup placement can be moved back or the frets are smaller than jumbo. Which isn't very common.

Speaking on that, you can get a 22 fret guitar with a 25.5" scale. Fender MIA comes to mind. Jumbo frets, but the pickup spacing is further apart.
Quote by CapnKickass
the fretboard is extended at the end for the last 2 frets. If the frets spaces were smaller the guitar wouldn't be intonated properly.