At runtime, the class (implementation) is injected. Spring sees you only have a single implementation of that interface and auto-wires it in.
As for why doing this: using an interface makes
testing easier (to mock out the interface), lets you write the front end before the back end is done and lets you substitute in another implementation later. In a nutshell, it makes your code more flexible.