That's a simplification.
We can get into an enormous debate, but the Supremacy Clause of the Constitution by its very nature rules out all unilateral secession.
Whether or not you believe that to be the case, James Speed (AG at the time of Davis' arrest) was 110% certain that it was the case and would have been more than happy to argue it.
That's why he indicted Davis for treason.
Davis fought the indictment, his lawyers seeking to have it quashed or nullified on the grounds that the court did not have authority over him.
This dragged on for four years.
After Davis lost his last appeal to have it quashed, the new Grant administration just took office and believed that starting the new administration with a trial that would reopen all the old wounds was just not smart.
I agree with that.
After the Grant administration dropped the case, which given the composition of the Supreme Court at that time would have gone 7-2 or 8-1 against Davis, Davis - now free and clear of any repercussions - started saying that he would want a trial.
Davis did not get himself elected President of the Confederacy by being a bad politician.
The government wanted Davis to ask for a pardon, but he refused this, feeling that to do so would be an admission of guilt. Davis actually wanted to stand trial for treason, because he felt certain that he would be vindicated. On May 5, 1867 he was freed on bond at Richmond, and soon after he traveled to a home that had been prepared for him near Montreal, Canada. In October it appeared that he would have to go back to Richmond for a trial, but that likelihood evaporated and he never stood trial at all. He eventually moved to Mississippi and became a businessman.
reference please.