In academia, before you have a full time position you are often given the cautionary advice, "every talk is a job talk". This is often true, though not always in the short term.
Once you have a position, you are also told this, and "every talk is a funding pitch", i.e., to program officers, potential grant reviewers, etc.
There are other types of talks too. There are the "I might want to come to your university and am testing you out" talks, and also there are the, "We may want you to come to our university so are testing you out" talks. There are "tenure tour" talks, which is when TT professors travel to other universities to show off their steak knives and court letter writers. Sometimes this works in reverse, where junior faculty invite potential letter writers to their university to give talks.
Sometimes people give talks due to geographic convenience, or because they want to start a collaboration/friendship/etc with someone at that university.
I suppose sometimes a talk is just a talk, but I suspect that's the exception to the rule.