When you visit the "reputation" tab the events that have occurred since the last time you visited that tab are highlighted. In your first three images these are the the lines with yellow background.

You are seeing two separate lines for the 'Why "foo\\<NEWLINE>bar" becomes "foo\bar" after "gcc -E"?' question because three of the upvotes on that question occurred prior to the last time you looked at the "reputation" tab. The other 15 upvotes and the accept occurred between the last time you visited the reputation tab and this time.  Thus they are highlighted.  The total of the events that are highlighted is the same as the reputation change total displayed in the tab badge:  
[![Reputation tab bagde][1]][1]

At least the "reputation" and "responses" tags both have tab badges displaying the number changed/added from the last time you looked at that tab. You can see the badges when the page is reloaded at a time when such changes have occurred. Both of those tabs highlight the added events/responses.

From a UI point of view, I would expect that the number of events shown when the line is expanded would match the number of events listed in the summary line. Thus, I would consider that all events are shown under both to be a bug, but it might be a misfeature. However, that is just my opinion about how it should work. I'm not in a position to duplicate this at the moment. I thought I had previously looked at such and seen that the number of expanded events matched each summary line for both the highlighted and non-highlighted summary lines (i.e. that the number of events were different).

  [1]: https://i.sstatic.net/D8uRY.png