What does the ending tion mean at the end of a word?

It means the state or condition of being. For instance, detention is the state of being detained.