Sandkings by George R. R. Martin

In a distant future where interstellar travel and exotic pets are commonplace, a wealthy and arrogant collector acquires a unique species of insect-like creatures known as sandkings. These creatures, capable of building complex societies and worshipping their owner as a god, become the center of a chilling tale of hubris and downfall. As the collector's cruel experiments and neglect spiral out of control, the sandkings evolve beyond his expectations, leading to a gripping and terrifying confrontation that explores themes of power, responsibility, and the consequences of playing god.