I think this is because the sentence will be more clear if the reader stop reading (or speaking) for a half second at each comma.
Well, a comma is sometimes used to denote a pause. But in this case, it is not "a" comma after "and", but a pair of commas after "and".
We use a pair of commas to set of parenthetical elements (nonrestrictive clauses). A parenthetical element adds important information, but it is not essential to understanding the sentence. Parenthetical elements are not needed to identify a noun/noun phrase.
But I am not sure what are grammar rules here?
There are no grammar rules here. Just that nonrestrictive clauses are set off by a pair of commas when they are in the middle of a sentence.
In your first example, if you remove the parenthetical, the sentence still makes sense.
Facebook is a prime example and 82% of users have more than 100 friends in their accounts.
Compare this example:
The police quickly ran up the stairs and, concerned for the safety of the hostage, kicked the door down.
In this case, the parenthetical adds information that explains the reason behind their action. But it is not important in understanding the sentence itself:
The police quickly ran up the stairs and kicked the door down.