how much does age gap matter

cause in game if you got a 20 year old and a 6 year old, is that worse than a 30 and 16 year old or would 40 and 26 be better....

hypothetically asking for a friend, 12 and 19 is only 7 years gap is same as 24 and 31 so it good right??
but lets say you had a 12 and 15 years and in 3 years its 15 and 18 which is still illegal but somehow ok in 3 more years with 18 and 21?!??!??