Eisenheim fell in love with sophie when they were just kids, but since Sophie was royalty and Eisenheim was not, they were forbidden to see each other. Later in life, Eisenheim reappears in town and once he sees sophie again, plots to free her from her current situation so that the two of them can live together. He knows she still loves him because she is wearing the locket he made her.
The best way to do this without anyone getting suspicious is to make everyone think that sophie is dead. Making the emperor believe that he had killed her made it easy to execute the plan.
As far as a rivalry, the emperor is known to abuse women and once Eisenheim embarrasses the emperor during his private show, Eisenheim is banned from performing. The emperor is not a nice guy and it is portrayed that the country would be better off without him.
So, to answer your question, Eisenheim tricked everyone, including the emperor, into thinking that he had killed sophie to prevent him from trying to find her once she left (or trying to kill her when she tried to leave). But in order for the two of them to be left alone, the emperor needs to be either arrested, or dead. The emperor did not kill himself out of guilt, however, he killed himself so he would not be arrested after his plot of overthrow his father (The real emperor) was exposed.