Why the id matters
Usernames change hands: when someone renames their account, their old handle can be taken by someone else. The user id stays with the account for life, so it is the safe way to store, follow or monitor an account. Accounts made since 2016 also carry their creation time inside the id, which the tweet ID to date converter can read.
To look up many accounts at once from code, see the user id lookup guide. To check what an account was called before, see Twitter username history.