Music is part math and part emotion. Because I've been a solo performer for most of my life, I sometimes (maybe most of the time) suck at the math part of it. I'll change tempo in a song a few times during a single performance, I'll play quarter notes when I should be playing half notes, etc. I've got friends that play like metronomes, very technically precise no matter what's going on around them. Maybe it's a simple matter of focus.
Of course, there are musicians out there that focus too much on the technical, precise aspect of playing, and their performances suffer because of the lack of emotion. You have to feel connected to your material, or at least give the impression that you are, so that the audience will feel connected as well. You can listen to two technically precise renditions of the same piece of music, played on the exact same instrument under the exact same conditions and like one version much, much better.
Sometimes your playing can be all over the map and you'll have a great gig in spite of yourself. I've had that happen a few times. When everything goes right for me it's almost like a spiritual event. Playing and singing become effortless, the audience is paying close attention, and I feel an almost overwhelming sense of peace. I feel connected to everyone in the room and in that moment there is nothing else in the world I'd rather be doing, and nowhere else in the world I'd rather be. I've even had this experience, fleetingly, during gigs when the audience wasn't paying attention at all, except for a single song when everything came together for three and a half minutes of perfection.
There have been more sports bars and dives on my schedule than I would have liked, and too few real concert opportunities and experiences, but this is true for most professional musicians. The ones you hear on the radio and read about in gossip magazines are the lucky few, probably less than one percent of the working musicians out there. It doesn't matter. We've all had gigs from hell, and we've all had those fleeting, transcendent moments when everything felt right. It's the memories of those moments and the possibility that they'll happen again that keep you going.