You may be surprised to know that all ants were human-beings to begin with. They lived by tilling soil and raising crops just as farmers do even now.
But not content with what they got through their labour, these farmers always had their eyes on the crops of their neighbours. Not only this, they even stole their crops whenever they got a chance. Thus they used to add to their own store.
These acts offended the gods a lot and they complained against the thieving farmers to their chief—Jupiter. He was so angry that he changed these farmers into ants.
But though these farmers had changed their form, yet their habit of thieving remained as it had been and it is the same even today. The ants go about corn-fields to gather grains which do not belong to them. Like customs, habits also die very hard.