There are several roles that a melee class can play on a raid. Usually, some of the melees (mostly plate classes) will be tanks and the rest of the melee classes will provide melee DPS.
Tanking means that the person is actively holding aggro on a specific monster, while meleeing means that the person is providing melee DPS without drawing aggro from the person who is tanking that monster. It is extremely important to understand the difference between tanking and meleeing: only people on the tanking duty should be using aggro weapons or drawing aggro via other means, while the rest of the melees should use non-aggro weapons and they should not use any means of drawing aggro off the tanks.
Usually - but not always - the tanks will prepare an order in which they should be taking monsters. The Main Tank will tank the first monster that comes to the raid, the Secondary Tank will tank the next monster if the Main Tank is already occupied, and so on. This will especially be the case when the raid uses pretargeting before pulling (more on that technique later). Sometimes (especially on easier and smaller raids) the tank order will not be strictly set (perhaps with the exception of MT and/or ST); then it will be up to all the tanks to find a monster they could tank (i.e. aggro), and if there are none left, switch to melee mode (i.e. assist MA and use as much DPS on that target without aggroing it). This means that tanks should be prepared to switch between tank and melee modes often - perhaps on every pull. The exact tank / melee assignment on each raid is usually determined in the tank channel before the raid.