Barty Crouch Jr. was about 19 when he was thrown into Azkaban. According to this answer, he spent 11 years and 10 months under the control of his father's Imperius Curse--over a third of his life. Toward the end of that time, Barty began to break free of the Curse to some extent, but he had no access to a wand until he stole Harry's wand during the Quidditch World Cup. How, then, could he be an effective teacher and perform the magic required to Confund the Triwizard Cup and later turn it into a Portkey? In Barty's own words,
It would have taken an exceptionally strong Confundus Charm to bamboozle that goblet into forgetting that only three schools compete in the tournament.
Yet Barty spent a longer time unable to use magic than he did studying at Hogwarts. Most people--Muggles, anyway--would begin to lose an ability if they neglected it for over a decade. How could someone who was barely an adult at the time of his arrest, and who spent the next eleven years Imperiused to his father's will, have such an exceptional knowledge of advanced magic, as well as the ability to use it?