TWAP and thinly traded

I understand that TWAP assumes a flat profile and trades in proportion to time but am trying to understand the logic of use. If volume patterns are erratic such as thinly traded, we use it. Why? I cant deduce why from that alone.

If we’re assuming a flat profile for volume, why does it work well when choosing an erratic volume pattern (seems opposite)?

Dont have much background in trading, so I’m assuming I just dont understand whats going big picture wise.

Thanks