This is the "Slap Bet" song performed and written by Marshall. This video is provided by youtube.com.
Possibly the most popular and favored joke in How I Met Your Mother; the Slap Bet comes up often in the show, and is usually a huge deal to the gang. The slaps are at random times, making each one funnier than the last. Now boys and girls gather round for the story of the "Slap Bet".
Once upon a time, Marshall, Lily, Ted, Barney, and Robin were downstairs at McLaren's pub. They were trying to agree about where they would hang out that night, but couldn't make up their minds. One of them finally came up with the fantastic idea of going to the mall. Robin quickly refuted this idea, causing great pandemonium among the group.
Marshall and Barney decide to make predictions of why Robin doesn't want to go to the mall. Marshall believes it is because she was married in a mall, while Barney has more inappropriate suggestions. The two of them agreed to make this a slap bet in which the winner receives permission to slap the loser as hard as he can. Barney and Marshall appoint Lily as “slap bet commissioner”, so they have someone to make judgments about their bet.
Robin tells them that she was married at one time, so Marshall wins the bet, and therefore slaps Barney as hard as he is able to. Marshall uses his pedantic lawyer mind to look up Robin's legal record; finding no record of marriage. Since Robin lied, Lily awards three slaps to Barney.
Barney reveals to the group that he is correct because a man in Malaysia found a video of Robin and Barney assumes that it is inappropriate. This dubs Barney the temporary winner. Robin comes in, telling them that this is an incorrect assumption; the video actually reveals an embarrassing video of Robin Sparkles, Robin's 80s teen pop sensation with her hit song "Let's Go to The Mall". She toured all of the malls throughout Canada, traumatizing her of trips to the mall for the rest of her life. This meant that Barney lost the bet. Lily awarded five slaps to Marshall for whenever he feels the need to hit Barney.
Barney is caused to live in complete fear, just waiting for Marshall to use his five slaps. These
slaps build up to important plot turns in the episodes.