Question from the Spring test

How does Spring match beans?