How does this person-sending-us-a-check scam work?

From here.

You’ve been hired…and scammed.

Often fake check scams and run in tandem with job-search scams. You’ll hear that you’ve been “hired” and instructed to deposit a check in your bank account, then withdraw most of the money and wire it to someone else. Victims are told to keep several hundred dollars of the money as payment. When the checks are later discovered to be phony, the banks reverse the deposit and the victims are left liable for the money withdrawn, usually several thousand dollars.

Even if you’re not asked to forward on part of the funds, unexpected checks can still be scams. For example, you might be liable for the amount of the counterfeit check, your endorsement might give your account information to fraudsters, or you could receive follow-up attempts to phish for personal financial information — or some combination.