It was a continuation of the shriving of Shrove Tuesday.
Some Church rituals make the ash out of last years palm crosses and mark the worshippers forehead with an ash cross.
Like all ceremonial stuff, ash does nothing in itself. If genuinely applied it strives to encourage the wearer to be "extra repentant" and to seek God's forgiveness as part of the on-going preparation for Easter.
Under God's Grace, forgiveness is not dependant on outward ceremony but on an inner "change of heart".
But there is great merit in using the forty days of Lent to spend more time in Prayer and Study with or without ash.