Most photographers use their cameras on a daily basis with little or no thought to how it functions under the hood. For the most part, this makes sense, mastering a tool doesn't require understanding exactly how it functions on the most intimate technical level. There are, however, aspects of camera operation that a cursory knowledge of can aid in being better equipped to address unexpected technical or mechanical issues. Given that autofocus can be finicky, it quickly becomes one of the critical aspects of your camera that you should take the time to learn about.
The first and most important aspect of autofocus in a DSLR that needs to be understood is that each DSLR camera has two distinct autofocus systems. When focusing through the viewfinder you are using a technology called phase detection while activating live view switches over to a system based on contrast detection. This happens because contrast detection is not possible unless an image is actually being projected on the sensor itself while phase detection can function without the camera's sensor being part of the operation. Understanding the difference between these type of autofocus can help you make the decision of which autofocus mode is a preferable choice in each given situation as a shooter.
Phase Detection Autofocus (Viewfinder)
Phase detection autofocus functions using a pair of micro lenses to compare light flowing through opposite sides of the lenses. It then aligns those two images on top of each other. Due to the images being drawn from a different position on the main lens the pair of images will be slightly different. However, the point of critical focus will be perfectly aligned. If this point of critical focus is within the bounds of the active autofocus point, the camera is in a focused state. Because of the nature of this system, focus points cannot reach the edge of the frame as the analysis becomes more difficult as the focus point is moved further from the center. As far as I understand it, it's impossible on the edges. Phase detection requires incredible precision in order to function correctly and even the slightest misposition of the micro lenses relative to the main lens can cause the system to become inaccurate. For this reason, all modern DSLRs include an autofocus micro adjustment tool built into the camera that allows users to configure their autofocus to be perfectly aligned for each lens in their collection. Phase detection autofocus has had an incredible improvement over the years and continues to further improve as time goes by. Leading DSLR companies continue to add more and more autofocus points that creep closer and closer to the edge of the frame while accuracy, especially in low light, continues to rise.
Contrast Detection Autofocus (Live View)
Contrast detection autofocus, while comparably complex in theory, is actually much easier to understand in layman terms. When autofocusing in live view, a DSLR records images from the sensor in real time that it then analyzes for the intensity of contrast between adjacent pixels within the bounds of the focus point. If the contrast intensity reaches a required threshold, the camera is in a focused state. Because contrast detection analyzes an image from the sensor itself, the analysis can be done on any area of the sensor without difficulty. For this reason, live view autofocus can target even the far corners of the frame. This also allows contrast detection autofocus to, in theory, be more accurate as it is analyzing the actual image instead of trying to determine whether the camera is focused or not without actually looking at the data that will be recorded by the sensor. For this reason, contrast detection never requires autofocus fine tuning and tends to consistently deliver accurate focus so long as there is sufficient light for the sensor to record an image that can be accurately analyzed. As a side note, this is why you should always fine tune your autofocus using the viewfinder, not live view, as autofocus fine tune will not have any impact on your live view focusing system.
Which to Use?
The primary difference, at least for DSLR users, is speed, reliability, and accuracy. As contrast detection requires switching in and out of live view between each shot, focusing using live view can be frustratingly burdensome. Meanwhile, the slightly less accurate phase detection system will allow for far more agility in use at the cost of reliability and accuracy. It is also worth noting that when not using a tripod that most photographers are more stable when holding the camera to their face rather than with outstretched arms to be able to see the LCD which means in certain situations the added camera shake may easily outweigh any benefits achieved by leveraging contrast detection. Ultimately, there is no right answer for every situation, rather it is up to you as a photographer to practice and be familiar with both system so that you can make an educated decision while shooting to decide which autofocus system is superior in your given situation.