1. this follows an extensive screen, where we have a strong signal whether the candidate is a good fit
2. the project isn't "offloading a current project" to someone to do free work for us; it's marginally related to our core product but pretty generic
3. the project is explicitly meant to take at most a few hours (we even use this as a way to gauge whether a candidate tends to over-engineer things)
4. we do a proper code review and architecture discussion after the candidate has submitted an implementation; we take as much time and put as much effort as with production code reviews; we probably put in almost as much time evaluating the candidate as much as they take to do the assignment
All this has worked pretty well for us, a mostly remote team, where interviewing has its own difficulties.