When AMMs connect to Metamask what information are they taking?

Hi.

When I use Pancake Swap (and other AMMs), they ask to connect to Metamask.

What does the AMM actually do and what does Meta do?

So I’ll connect to Pancake Swap and swap BNB for a token, then Metamask asks me to confirm the transaction, and the tokens are swapped.

Does Metamask send my key or anything to PCS and the PCS create the swap, or does PCS just send the parameters to Metamask and Metamask generate and broadcast the transaction?