Why were European countries imperialists?

Their colonies made their uleres and middle class wealthy, and enhanced their m ilitary power relative to other European nations.