There are two types in which art is created.
Pursuit of craft
A person likes certain craft - writing, painting, singing, playing guitar, doodling, etc. If they like it a lot they pursue it for a long time. After years they create artifacts (paintings, songs, novels) that are interesting in some way. If they can trigger some kind of emotional response in the audience then they qualify as an artwork. However they are not necessarily created in order to trigger that certain response.
Search for meaning
A person creates an artifact in search of meaning. They have a certain emotion to express or a certain concept to communicate. They try to do it by choosing a suitable medium (music, picture, words) to creating a tangible artifict (song, painting, poem). In doing so they are exploring an abstract idea in their mind. In the process they are looking for the meaning of that idea and trying to convey it through the medium. When the audience consumes this piece of work, they will likely see the reflection of the original emotion that inspired the artwork.
Great works of art are created when both these motivations blend inside an artist.