The chown command change file owner and group. The chmod command change file mode (bits) i.e. permission. A wrong permission can create problems on Linux or Unix-like system. It is clearly illustrated in this comic.
Linux and Unix chown and chmod command security problem illustrated | Ecency