What is behind entering email twice for registration?

What do you think to ask the email twice for registration?

The context is this: In the e-commerce checkout/registration process where the email is mandatory to save cart or to proceed to the checkout, it's better to ask just one time the email and the pass twice or it's better ask the email and password twice to be sure the user fill correctly all the fields.

In the first case the risk should be that users can might some mistake and fill the email form wrong, the second case the risk should be to abandon the registration/chechout because is frustrating.