first off, 4h assignments are almost never 4h assignments. at best they tend to be 4h coding, 1h of non-coding stuff (check out repo, branch repo, create repo, pr etc. read specs to make what you are going to make)
I have only ever had one actual 4h assignment that took exactly 4 hours, I was amazed. They actually wanted me to spend more than 4 hours.
I also had one assignment that had a bug in a particular library that was supposed to be used, I spent 4 hours solving that bug, at the end of which I could then have spent 4+ hours to make the solution.
but most assignments are in the 6-8 hour range while advertising 4h.
Part of the reason for this is most assignments are supposedly wanting you to make quality solutions etc. which is at odds with the supposed reasons for you to take assignments which are, as I have heard it stated, that a large number of programmers don't know how to program or program so badly it isn't worth hiring them. But take home assignments are not just that you can program (so you don't make the mistake of hiring someone who then sits around for a few months not contributing before you fire them) but also that you can produce quality code, that is to say it is really worthwhile hiring this person.
think about it, you want to hire a senior, but you think a 4 hour assignment is going to really help you determine that they are a senior? I remember a fellow I worked with once had a ballpark rule that the smallest time a ticket could take would be half a day, so 4 hours. Why that? Well once you added in reading the ticket, asking about any not well specified parts, made your branch, did the code, tested, made pr, accepted code review, you were almost always at 4 hours. (it was only a ballpark rule, obviously there were some 1 lines, typos etc. that took less but most often 4 hours was a trivial ticket)
So you are able to test the quality of a potential hire by giving them a trivial ticket?
So this leads to people 'cheating' on the assignment, doing more than 4 hours. So maybe 4 hours of coding, but then cleanup, then maybe modularization, then documenting what you did sending back the message etc. This was basically what that 4h assignment that really was 4h I discussed earlier wanted, they wanted me to make everything pretty after I finished. They asked me if I had another hour what I would have done, I guess at that point if I still wanted the job I would have said I would have done these things but instead I said I would have taken a nap because I finished the job as described in 4. Because, he I am willing to take a little test or something to prove yes I can program but not waste 4 hours of my life.
I also have a family as has been pointed out is a real filter on people being willing to do this.