It wasn’t.
With rare exception, colonies were unprofitable, meaning more was spent building infrastructure like roads, railways, buildings, etc. than was exported.
And look at places like Singapore and Hong Kong. Both were colonies for a long time and yet they are extremely prosperous.
Internet just be talking ain’t no one way to get rich I done seen the disciplined and undisciplined get rich. I done seen a dumb niga get rich and a smart nigga.