If you do something deliberately, with complete awareness, you do it knowingly. Did you knowingly eat the very last cookie, or did you think there were more in the cookie jar?
Use the adjective knowingly for things you do on purpose, with full knowledge of what you're doing and what the possible consequences might be. When you act knowingly, you've thought things over first. Another, more subtle meaning, is to do something in a way that communicates the fact that you know a secret: "She winked knowingly even as she insisted she hadn't heard anything about the surprise party."