With CRTs, how did the input device know when to fire in sync with the CRT? I assume the CRT was operating on some factor of mains power for its timing?
The CRT fired in sync with its input signal, not the other way around. Timing was done through HSYNC and VSYNC as well as the blanking intervals - the area after the sync signals where no image signal was to be sent. VSYNC was locked to the net frequency on televisions and early monitors but could be configured within certain bounds on later models, HSYNC depended on the intended vertical resolution ((Vres + blanking/shelf) * VSYNC = HSYNC), the dot clock decided the horizontal resolution. Positioning was relative and depended on how the monitor was adjusted - horizontal and vertical deflection, pillow deformation, trapezoidal deformation, etc. CRT tubes had no concept of 'pixels', those were a function of the dot clock/HSYNC/VSYNC. Colour tubes had RGB triplets in either delta shape - three dots in a triangle in combination with a shadow mask with round holes - or next to each other for in-line, those with either a shadow mask (a metal plate with loads of slits) or a wire mask (thin vertical metal wires strung between the top and bottom of the CRT. There was no fixed relation between display pixels and those triplets, especially on later high-bandwidth multi-sync monitors this could result in display pixels taking up less than a colour triplet which led to odd colour effects on small details. I used a 17" CRT at 1600x1200 which often showed such effects on the small fonts I tend to use so as to cram as much as possible on the screen.
The input signal combines video amplitudes (positive voltages) and sync pulses (negative voltages) which tell the CRT when to move the beam around. Technically composite video is AC-coupled so I'm not sure how sync pulses are actually identified (but video brightness is relative to the porch voltage right after a sync pulse). Not sure if antenna TV RF signals are DC or AC coupled.
I believe there are timing pulses in the blank area of the signal that it syncs to. But it depends on the signal.