"Truth is always bitter to those who fear it!"
In Alice's head, the Hatter represents her paranoia, directionless fury and overall madness on a good day. That being said, he himself is a psychotic, riddle-spitting genius who violently slides between urges to reanimate the dead(or already living, even) as clockwork men, much like himself, and to return to his never-ending tea-parties like he went to in the good ol' days. His development as a figment of Alice's imagination appears to be largely complex: from shooing her off from a tea-party, to attempting autopsies on her resulting in transforming her into a mechanical monster, to ultimately begging her for his life and helping her reclaim her brain from the real world, it's hard to be certain of exactly how she'll be treated on her next visit. Hell, it wouldn't be entirely out of left field to assume that he didn't know himself what would happen...
As it's been aforementioned, the Hatter himself is a partially mechanical being; with that in mind, much of his own body is weaponized. His fingers hide bullets and small knives, and with the pull of a hidden string his own hat mimics the actions of a cannon. He wields a cane that serves as both a walking-stick(though it doesn't give him much physical support) and a weapon; he's often seen smacking it against his hand when he's in deep thought, so it'd be best to keep your distance since anything could follow this action. He's also pretty agile-- his feet are spring-loaded, so running and jumping aren't a problem in means of defense.
When Alice meets him the second (third? fourth? does anyone even count it?) time in her brain's timeline, she might've described the Hatter as less than friendly, to put it lightly. Becoming progressively obsessed with time and mechanics, he eventually lost all control over trying to fight back the insanity that had twisted the world around him. To make a long story short, he ended up making a deal with the wretched Queen of Hearts-- he begins working for her, if she gives him all the gears and cogs he could toy with. At some point he had hired the Tweedle Twins to begin stealing children from the asylum Alice had projected into her own mind: these children he would use to test his limits of knowledge with the concept of building a "technical marvel" that could hold Alice back long enough were she would give up fighting the Queen.
Too bad that didn't happen.
By the time Alice had made her way back to Wonderland, the Hatter was a shell of a cyborg-- he had been overthrown by the girl herself, and was physically dismantled(which he didn't suffer pain from, mind you)by his greatest successes, the March Hare and the Dormouse. For half a year he was left to rot in her brain, forced to witness his empire destroyed by his former friends and driven to hate himself for what he had done. He managed to "repent," if you could call it that, by returning Alice's favor of reassembling his body. This favor slowly deteriorated in his own brain, though-- he was so far gone that he could only bring Alice to see what it was that was corrupting her memories before coaxing his dead buddies to wake up for tea as his laboratory caved in on itself.
As our doctors will meet him now, he has begun to rebuild his domain at last, as well as his reallied friends and the insane children it housed: not as weapons of keeping Alice away, but for their own means of defense. Since Alice and he had helped eachother despite their former feuds, he has become extremely protective over her. But will he be able to warm up as easily to her newfound friends...?