The lighter was invented before matches
It was 1823 when a German chemist named Johann Wolfgang Dobereiner is credited with inventing the first lighter.
It wasn’t until 1826 that a man by the name of John Walker from England invented the first actual match. (you know the kind you rub, it needed friction to light) However, Walker’s matches weren’t very reliable so the match (at the time) never really saw success.
Carl Auer Von Welsback patented the ferrocerium in 1903. It was this that made lighters as we know them today, possible. It is when the flint is scratched that it produced a large spark that is responsible for lighting the fuel in lighters.
Bonus Fact: Today’s match making machines can produce over 10 million matches per 8 hour shift, with minimal people to monitor the operation