High-order harmonic and attosecond pulse generation on plasma mirrors: basic mechanisms