Yeah it’s just like the Magic Mouse - I use that between my Mac mini and my MacBook Pro, just plug it in for a second to get it to switch. Pencil’s even simpler, just snap it on magnetically!
BTW I just got an iPad mini 6 to complement my M1 12.9”… excellent combo 👌