Because ad-hoc connection protocol is simpler than access-point connection (via router). In ad-hoc case you have only two entities that talk to each other, while in access-point case there can be many entities and protocol has more overhead to be able to handle that. This overhead is still present even if only two computers connect.
Another reason is that transferring files is usually done via TCP protocol -- the other party has to send response to confirm that data was delivered. So the data has to travel to the other party and back though the router, rather than directly.
Internet has nothing to do with file transfer, unless it's one more party connected wirelessly to the router and also requires some air time.