When you knock, you bump or strike someone or something. When you hear a knock at the door, someone on the other side is thumping it with their knuckles.
You can accidentally knock your grandmother's special glass bowl off the table, and you can also knock softly on her door — or tap with your knuckles — before you go in and tell her how sorry you are. If a car engine knocks, it makes a rattling or rapping sound. Colloquially, to knock something is to reject or criticize it, and if you do, you may hear the phrase, "Don't knock it until you try it!"