I should begin this post by stating up front that I am still waiting for my own DNA results to come through, but whilst waiting on those results I have watched quite a few videos about thrulines from various sources including Ancestry. I think I have a pretty fair idea of what they are and how they work.
Thru lines are - according to Ancestry themselves - hints based on trees currently on Ancestry.
What thru lines do, or attempt to do, is make the connection between you and a DNA match through the people in your tree, your DNA match's tree and other trees on Ancestry. Basically, it works in many ways the same way as the relationship to me feature within your own tree.
So, let's assume you have a tree which is entirely correct, at least as far as your great grandparents, and you get a DNA match to a second cousin who also has a perfectly correct tree as far as their great grandparents. Since you are second cousins, one couple from the match's great grandparents are of course also your great grandparents, on your tree. In this idealised case, you both have that couple correctly identified, with correct names, dates of birth etc, so Ancestry can easily see that they are the same. Thru lines will then draw a line through your ancestral line to the relevant great grandparents (or one of them anyway) and then back down through the DNA match's tree to them. In essence, it is showing you the connection between you and your match. Of course, in this case, you would probably find the match anyway by looking at your common anestors, so all thru lines do is save a little time.
Now let us suppose you have another DNA match, who is a fourth cousin. Let us also continue to assume that both your tree and theirs is "correct". Let's suppose, however, that whilst their tree goes all the way to their 4XG grandparents (at least on the line common to you) yours goes just one line further than the great grandparents mentioned in the previous example. Fortunately, their tree does have your 2X great grandparent in their tree as a sibling of their 2XG grandparent, so once again, Ancestry recognises that person as the same as your 2XG grandparent, and joins them up, effectively giving you a HINT as to who your 3XG grandparent is. In this case, since your trees actually have no common ancestor, it would probably take longer to figure out without thrulines, but you might well have got there anyway, and you still should do research to establish a paper trail.
Both of the above are almost ideal cases - sadly in the real world it doesn't always work out that well.
Let's take a third example. This time the person that shows up as a DNA match is actually a fifth cousin, but their tree only goes as far as their great grandparents. Let us suppose that your tree goes back to your 9XG grandparents (on the relevant linking line) and that you have added some, but by no means all of the siblings of your "direct" ancestors. Let us further suppose that a third Ancestry member has one of those siblings in their tree. In this third tree, that sibling ultimately links with the great grandparent of your DNA match. Ancestry will now show you a path through (ie a thruline) your tree, the third person's "linking" tree, and finally your math's tree down to them. As long as all three trees are correct, everything in the garden is rosy, but of course there is an obvious flaw in the system - it relies on the accuracy of the three trees. That said, it gives you a very clear possible trail which gives you some significant clues to help with good old fashioned genealogical research to prove an actual link.
In short thrulines attempt to join up the dots using other Ancestry trees, but it does it by using the contents of those trees, not DNA. The only person in this scenario to whom you can be sure of a DNA link is your actual match.