Tennis was first developed in France and its original name was ‘tenez’ derived from ‘tenir’ meaning ‘here you are’.
However, tennis lost popularity in France and gained greater popularity in England. Each time British people hit the ball they used to say “tenez”, which in the British accent sounded like “tennis”.
This is how tennis got its new spelling. When tennis gained popularity all over the world, even French used to spell it like “tennis”!