What component of my phone charger produces chirps and how does it do that?
As long as the battery is nearly empty, your charger produces its nominal current and runs constantly at a frequency that is likely around 100 kHz > 15...20 kHz = your audible range.

Once the battery is nearly full, the charger goes into burst mode. This means that it switches at 100 kHz, stops switching entirely, and then produces some more cycles at 100 kHz (i.e. the next burst), stops again, ... (repeat).

What you hear is not the main switching frequency, but the frequency of the bursts. You can think of this like an amplitude modulation between 0% and 100% with an inaudible carrier of 100 kHz and a signal of the burst frequency, likely of some kHz and in the audible range.

The reason this is done is that you are able to greatly reduce the standby power consumption of a charger using burst mode. (A nearly full battery looks to the charger like "almost standby".)

For further reading, you can search for keywords like "burst mode" and "switch mode power supply".

The components producing the noise are the transformer, and maybe the EMI filter chokes.

It could also be the case that the charging circuit inside the cell phone modulates its current consumption and thereby imposes an audible modulation onto the switch-mode power supply inside of the charger device.