Q:

How Spring Data JPA picks up / identifies underlying JPA Provider?

I am learning Spring Data JPA, and for that I am writing Simple standalone application. Here is the sample code:
Entity class --> User.java
@Entity
@Table(name="USER_DETAILS")
public class User {
    @Id
    @Column(name="SSNID")
    private int ssnID;
    @Column(name="FULLNAME")
    private String fullName;
    @Column(name="CITY")
    private String city;
    // Getters and Setters omitted
}

The Repository class --> JPADBAccess.java
@Repository
    public interface JPADBAccess extends CrudRepository<User, Integer> {

    }

A simple service class which uses the repository --> DBServices.java
@Service
public class DBServices {

    @Autowired(required=true)
    private JPADBAccess jPADBAccess;  // How does this work?? ---->(1)

    public void saveUser(User user) {

        User queriedUser = null;
        jPADBAccess.save(user);

    }
}

The Spring configuration file looks like:
<?xml version="1.0" encoding="UTF-8"?>
<beans ... ">

<context:annotation-config/> <!-- This enables the annotation's actions, else annotations don't do their work. -->
<context:component-scan base-package="com.example.service"/> <!-- This is for component scan -->

<jpa:repositories base-package="com.example.jpa"/> <!-- This enables support for Spring Data JPA. -->

<bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
      <property name="dataSource" ref="dataSource"/>
      <property name="jpaVendorAdapter">
         <bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
             <property name="showSql" value="true"/>
             <property name="generateDdl" value="true"/>
          </bean>
      </property>
 </bean>

 <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
      <property name="driverClassName" value="org.h2.Driver"/>
      <property name="url" value="jdbc:h2:tcp://localhost:9092/~/test"/>
      <property name="username" value="sa"/>
      <property name="password" value=""/>
 </bean>

 <bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
       <property name="entityManagerFactory" ref="entityManagerFactory"/>
 </bean>

The persistence.xml looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence" version="1.0">
    <persistence-unit name="userPersistenceUnit" transaction-type="RESOURCE_LOCAL" >
    <class>com.example.model.User</class>
</persistence-unit>

The standalone classes looks like this:
public class MainApp {
    public static void main(String s[]) {
        DBServices dBServices = null;
        User user = new User();
        user.setSsnID(1);
        user.setCity("Blr");
        user.setFullName("Full name");
        ApplicationContext appContext = new ClassPathXmlApplicationContext("spring-config.xml");
        dBServices = (DBServices) appContext.getBean("DBServices");
        dBServices.saveUser(user);
    }
}

Now it works all fine, I am using Hibernate as the JPA provider (by simply placing the jar's in the classpath).
I have following questions:
1) How does DBService gets the instance of JPADBAccess by @Autowire  when there is no bean defined in the configuration file. 
    @Autowired(required=true)
    private JPADBAccess jPADBAccess;  // How does this work?? ---->(1)

2) How does Spring Data JPA uses or infers that the underlying JPA provider is Hibernate, when there is no mention of Hibernate in any of the configuration file?

A:

1) How does DBService gets the instance of JPADBAccess by @Autowire when there is no bean defined in the configuration file.

This is the magic of Spring Data JPA: it finds your repository interface and automatically generates an implementation of it, which is put in the Spring application context. In the class where you autowire JPADBAccess, Spring finds the auto-generated implementation.

2) How does Spring Data JPA uses or infers that the underlying JPA provider is Hibernate, when there is no mention of Hibernate in any of the configuration file?

But there is, in the entityManagerFactory you specified a HibernateJpaVendorAdapter bean.

