Depends how you're managing languages in your EE build (e.g. Transcribe, Publisher, hand-rolled).
Either way, it will be cookie or session based, dropping a variable that states you've automatically taken them somewhere and not to do it again. Best method is using the Session add-on.
Detecting the users location via IP will probably require GeoIP or IPGeo.
But fundamentally please consider your users!!! It's very bad for you to assume that you know what they want. I'm English and and work in Holland, I follow a link to the English website but you're going to force me to the Dutch website - WTF?!? The Googlebot, is happy to crawl and index your website, but everytime it tries to start it's crawl from the Dutch homepage it gets forced to the English website because it's based in the US! This does have massive implications to SEO performance. Here's a slideshow from a presentation regarding the SEO issues of internationalization that may help (alas there wasn't a video of it).
A couple of other posts on Stack Exchange that may help:
Redirect multi language site based on IP address
how can I redirect a homepage depending on the browser language settings