Pope Stephen VI had a hunch that he needed to bring to trial. He believed that Pope Formosus, who was the Pope before his own predecessor, became the Pope illegally.
Pope Formosus was beloved within his church, especially due to his missionary activity among the Bulgarians. He was more outspoken than other religious figures at that time, which made him not very well-liked.
At one point, he was even excommunicated from the church. After the death of Pope John VIII, Formosus somehow resumed his bishopric and was elected as the Pope almost ten years later.
It was no secret that John VIII hated Formosus, which is why he was excommunicated. They didn't see eye to eye, but John VIII had way more power.
After Formosus died, things were pretty normal for a while. He was remembered for his good deeds, as most Pope's are.
That is until Pope Stephen VI came to fruition. He had a huge issue with the fact that Formosus was a "fake" Pope, to put it in simple terms. Through his power, he demanded that Formosus must be put on trial for his crime of perjury and his illegal papacy.
Well, he had been dead for years. Since Pope Stephen VI was indeed the Pope, they were forced to exhume Formosus' body and put him up to trial.
They propped the corpse up onto the throne and a deacon was speaking for the deceased pontiff. After a lengthy trial, the dead pontiff was declared guilty.
His corpse was stripped of anything that indicated that he was a Pope.
This didn't bode well for Stephen. He ended up getting deposed and imprisoned after his followers lost trust in him. I mean, putting a dead guy on trial isn't the best way to make you look sane and powerful.