Reading /etc/passwd with cat or grep is the habit, but it only shows local accounts. getent asks the system the way programs do.
getent passwd jordi
getent passwd 1000
getent passwd | wc -l
The first command looks up a user by name, the second by numeric user ID, and the third counts all users the system knows about. The output has the familiar colon-separated fields: name, password placeholder, user ID, group ID, comment, home directory and shell.
The point of getent is that it reads from the Name Service Switch libraries. What it consults follows the configuration in /etc/nsswitch.conf, so a user that comes from a directory service such as LDAP shows up as well, where grep on the local file finds nothing.
It works for other databases too, like getent group and getent hosts example.com, which resolves a name like programs do instead of asking DNS directly.
The exit status is useful in scripts: it is 0 when found and 2 when the key could not be found.
The caveat is about listing everything. Without a key, getent enumerates the database, and some sources do not support that or only return part of it, so the count of users on a machine with a directory service can be lower than you expect. Looking up one name is the reliable way.
Further reading: getent(1) manual page