The concept you're looking for is the Third-Party Doctrine (wiki).
As a concept, it's derived from a 1979 SCOTUS case (Smith v. Maryland) about whether the authorities could gather information about a phone call by placing a device (a "pen register") in the telephone company's office.
To quote the decision (emphasis mine):
Given a pen register's limited capabilities, therefore, petitioner's argument that its installation and use constituted a "search" necessarily rests upon a claim that he had a "legitimate expectation of privacy" regarding the numbers he dialed on his phone.
This claim must be rejected. First, we doubt that people in general entertain any actual expectation of privacy in the numbers they dial. All telephone users realize that they must "convey" phone numbers to the telephone company, since it is through telephone company switching equipment that their calls are completed. All subscribers realize, moreover, that the phone company has facilities for making permanent records of the numbers they dial, for they see a list of their long-distance (toll) calls on their monthly bills.
In other words, there is no "reasonable expectation of privacy" in the numbers you dial, because clearly the phone company knows what you dial.
In the internet age, this has been greatly expanded - now, instead of just phone numbers to the phone company, we send GPS data from our cell phones to the phone company, email to Google (or others), URLs we want to see to our ISP, etc. The debate going on now is whether we have a "reasonable expectation of privacy" in these things or not. The government draws the analogy back to Smith and pen registers, while privacy advocates point out that the scale and informative value of the information is vastly larger than was conceived as possible in 1979.
As my personal opinion, I think that the last line of the quote (which I didn't emphasize) is the most important one. If you're delivered a monthly list of every phone number you call (and for how long), it's perfectly reasonable to expect that the phone company could deliver that same list to the government on demand. But we aren't delivered monthly lists of every website we visit, so there's no cue to indicate that such things can be (and probably are) recorded by the ISP. Thus there is an expectation of privacy, because nothing violates that illusion.