How does each Mac know which mouse and keyboard to use if they're both wireless?
They work easily. You pair one, then pair the other to the other machine. Because they've paired - there's no intereference and there's no problem, even if you switch them off then on again.
I do it with two of my macs.