The ASH is a rolling buffer in memory: new data overwrites old data when the buffer is full. However, before the old data is overwritten, Oracle Manageability Monitor Process (MMON) takes a snapshot and MMNL flushes (every 10th record of) the ASH buffer into the dba_hist_active_sess_history view in the AWR.