What do chown and chgrp do, and who is allowed to use them?
chown changes a file's owner (and optionally its group), chgrp changes only the group; only root may give a file to another owner, while the owner may change the group to one they belong to.
sudo chown bob financedata.txt # new owner: bob
sudo chown bob:bob financedata.txt # new owner and group in one step
chgrp finance report.xlsx # new group only
Owners and groups can be given as names or as UID and GID.
Why only root can change the owner: otherwise users could hand files to others to get around disk quotas, or plant files that look as if someone else made them.
chgrp works for the file's owner too, but only to a group the owner is a member of. You cannot give a file to a group you are not in.
Making bob the owner of the finance file (chown) is the clean fix for "bob needs access to this file": it changes the rights on exactly that file, unlike the SUID-on-nano shortcut, which opened the whole system.
Go deeper:
Wikipedia: chown — syntax and who may change ownership.
man7.org: chown(1) — the reference for the
user:groupform.