Melee fighting is generally the last solution after losing all ammo or BP, however it can be powerful in the right hands. It may also be used to make traps (unexpected knockdowns) or harm lightsaber users (though it is rather dangerous). For Wookiees, melee is a very powerful weapon, and instead of kicks they use a claw attack which can be used while moving. SBDs and Droidekas cannot use melee, however the SBD can slap opponents and knock them down. Soldiers must buy the Close Combat Training ability to use melee effectively.
Jedi /Sith generally have the advantage in melee as they can leap up quickly from knockdown, even doing jump kicks, while most armored gunner classes take far longer to get up (with the notable exception being the ARC Trooper with dexterity). Most melee attacks are armor-ignoring, except for melee katas. The only thing likely to defeat a Wookiee in melee is another Wookiee.
Blocking using the reload key allows punches, kicks and some special attacks (but not katas) to be blocked given enough stamina. Blocking a punch as it hits you triggers a counter-attack, dealing 10-20 damage to the attacker.