The scenario I'm considering is basic:
page = driver.open_page(URL) linkElement = page.find_elements(XPATH) linkElement.click()
(I'm assuming I'm using a remote machine - i.e., remote driver). How does the server know on which element to click.
More generally, I couldn't find an overview of the selenium 2 implementation. That is, something that just tells the story but doesn't go line by line in the code, on the one hand, but something much more detailed than just the api.
You're right, there isn't a good one-size-fits-all "under-the-covers" look at how WebDriver implements the various parts of its API, largely because the actual implementation can be very different depending on the browser and the operating system. The closest you'll come is the various pages on the project wiki.
If I understand your question right:
You start remote web driver server. Through a remote driver client (that is your test), this server is told to fetch a page ('URL' is a variable set previously, for instance:
String URL = "http://www.asdf.com";).
Then the server is told to find all the elements on the fetched page by some XPath ('XPATH' is something like
By.xpath("//div(@class = 'some_button_class')") - this is java implementation of WebDriver and I'm not sure how it's used in Ruby). This command will return a list of WebElements - all the 'div' elements that look like this
<div class="some_button_class"><div>. Check out how XPath works, if you're not familliar with it.
Since you're using
 at the end of your command, you're telling server to return the first element from that list (the first div that looks like
Hope this helps.