How do the forget, input, and output gates work together inside an LSTM network? What role does each gate play in managing information stored in the cell state? How does this gating mechanism help LSTMs handle long-term dependencies more effectively than traditional RNNs?