It was built by the Turks in 1809 after the first Serbian uprising, to intimidate. Over time, it was destroyed, and the skulls were dragged away by locals thinking suddenly it was relatives. In 1861, the Turkish governor ordered the removal of the skulls, because on the contrary they angered the Serbs. In 1878, when Serbia finally gained independence, the Serbs returned the skulls they could find and built a canopy, and then a sarcophagus (it can be seen from the outside).
The tower itself has some information about its history, but not as much as we would like.
If you are in a Niche, then visit this museum, read the history. This is a very strong point about how much freedom costs. You can buy a ticket near the museum itself