If one of them has a public domain name or IP, or they are both on the same LAN (likely when one is a laptop and they are owned by the same person), then it's simple to communicate via git.
But, it wouldn't be so easy for, as an example, you and I to share code between our laptops in different time zones, unless we used a stable server somewhere.
Just opened a new account at Bitbucket and am going to start doing this.
Public repos on Github, Private @ Bitbucket. This is brilliant.
It's a free offsite backup, and if you ever need to add another machine (or developer) to the project, your code is already sitting there on bitbucket. And you never need to worry about firewalls, NAT, one of the machines being off, whatever, because bitbucket is (almost) always up and accessible. And if you forget to push after working, or if bitbucket is down, you can still fall back to your existing workflow.
In addition, if you're doing anything web based, sooner or later you'll need to deploy to a sever out on the internets. Being able to pull from bitbucket makes deployment really easy, again without tinkering with firewall ports or anything.
It's not so much a question of "need" it's "why not do this thing which has some benefits, and no real downside?"