All it’s doing is creating a variable called $my_count before the loop, and then setting that variable equal to the number 1. Then, once the loop starts, the variable increases by 1 after each post is displayed (the $my_count+=1 line).
So…if you’re using the default setup, the WordPress loop will pull ten posts and your $my_count variable would look like this:
$my_count=1
BEGIN WORDPRESS LOOP
POST #1
$my_count=2
POST #2
$my_count=3
POST #3
$my_count=4
POST #4
$my_count=5
POST #6
$my_count=7
POST #7
$my_count=8
POST #8
$my_count=9
POST #9
$my_count=10
POST #10
$my_count=11
END WORDPRESS LOOP
The “if” function says that your code inside the “if” function should appear if $my_count=3,6,9,12 — basically, any time $my_count is evenly divisible by 3. In the above example, your code would appear after POST #3, POST #6, and POST #9.
So a sample code would look like this:
<?php
$my_count=1;
if(have_posts()) : while(have_posts()) : the_post();
?>
<div class="entry">
<h1><?php the_title();?></h1>
<?php the_content();?>
</div>
<?php if(($my_count%3)==0):?>
<div class="banner">
Content of banner (Google AdSense code or whatever)
</div>
<?php endif;?>
<?php
$my_count+=1;
endwhile;
endif;
?>