When you are attacked, several things happen:

 - You lose resources, depending on how much the attacker "destroys".  If the attacker destroys everything, you can lose up to a maximum of 50% of Elixir/Gold in your collectors, 100% of Elixir/Gold in your Town Hall, and 33% of Elixir/Gold in your storage containers.  This is a worst case, and can be significantly less if the opponent is higher level than you, or does not fully succeed in destroying your buildings.
 - You lose trophies, depending on how much the attacker "destroys" and also the relative amounts of trophies you and the attacker have.  Attackers get 1/3 of potential trophies for each star they receive.  Potential trophies are more if the attacker started with less trophies than you, and are fewer if the attacker started with more trophies than you.
 - Your buildings are not ***actually destroyed***, even when the opponent "destroys" them.
 - Troops in your Army Camp do not participate.
 - There is a range of who can attack you. However, this is based on the number of trophies you have. This makes it possible for high level players to attack you. These players have just simply purposefully lost a bunch of trophies so they can "pick on" low level players. Bear in mind though that pairing is random, so in order for a higher level attacker to attack, they have to be randomly paired with you.  Note this does not apply if you've previously attacked them, since they have a "revenge" option.
 - If an attacker defeats your defenses, you will get an automatic shield to prevent further attacks.  If 40% of your buildings are destroyed, you will receive a 12 hour shield.  If 90% of your buildings are destroyed, you will receive a 16 hour shield.              

  1).http://clashofclans.wikia.com/wiki/Raids#Multiplayer