We currently think of the word happy as meaning “feeling or showing pleasure or contentment”. However, originally it meant ‘lucky or unforeseen’. It came from the root word ‘hap’ meaning ‘by chance’ plus the suffix ‘y’ and of course you need to double the consonant in ‘hap’ before adding the suffix ‘y’ to keep the vowel sound short.
You can see this root word ‘hap’ in words like ‘mishap’ where it still retains the original meaning of ‘luck or by chance’. The suffix ‘mis’ means ‘bad or not’, so ‘mishap’ is literally ‘not lucky or bad luck’.
‘Happen’ literally means to occur by chance. The suffix ‘less’ means ‘without’, so ‘hapless’ means ‘without luck’, in other words, ‘unfortunate’. ‘Haphazard’ combines ‘hap’ with ‘hazard’ meaning ‘risk, danger or peril’, so literally a ‘chance danger’. However, today it is more commonly used to mean ‘lacking any obvious organisation.
Reference