The use of the semicolon is what's known as a "vexed question". In other words, people disagree about it!
You do quite often find one statement written in a sentence, after which only a comma is added before another statement is introduced which could equally well have been written as a separate sentence. That's the case in both of your examples. Either of them could have used a comma, or a semicolon, or a full stop/period. In my view it's mainly a matter of personal choice.
Where semicolons are particularly useful is in a list of items in a sentence, in which some of those items are themselves subdivided by commas. In such a case, semicolons between the main items are very useful for clarity.