For either the candidate being discussed (pro or con) or for whatever party (if any) paid for/supports the ad.
For the POTUS ads no big deal, but the downballot ads NEVER tell me that Gov./Senator/Rep. X is a Democrat or Repub. I had to Google them to ID their party.
Why do they do it this way?
Because they believe they can get more votes that way, most likely because they think that the candidates at the top of their parties tickets are unpopular in their jurisdictions.
Why should they?
(By which I mean, not “Why would it benefit you for them to do so?” but “Why would it benefit them for them to do so?” How would doing so make you more likely to be influenced by the ad?)
I see it a lot around here (Chicago area) in state legislative elections from Republicans. Springfield has a supermajority of Democrats and I guess the GOP candidates feel that not mentioning their party affiliation (and often with green or purple campaign signs) will help keep people from immediately rejecting them.