How does Membership know which gateway to use?

I’m trying to get the final kinks worked out, and it’s just not working out.

How does membership know which gateway to use?

How does membership know if it’s a recurring billing or single payment?

Where can I tell it to use one or the other, depending on user preference?

Or, does it know the gateway simply by selecting finite or serial?

Which setting tells membership that a user wants recurring billing?

Is it dictated by Paypal, and if so, where?

I need to know specifically how membership uses the two different paypal options, how it knows which one to use.

1. I need a single payment plan (1 year term).

2. I need a recurring payment plan (1 year term).

3. I need a recurring payment plan that only lasts for 12 months and then stops.

I need to know how these gateways pick and choose.