I think he found out when he went to the alien ship and was "tell me all you know about all the knowledge you've gathered from hundreds of planets." I mean Clark Kent's identity. No idea how he found out that Bruce Wayne was Batman but.....Bruce Wayne did keep the Bat signal at the destroyed Wayne Manor so (that's where it was, right? or was it a warehouse?).....so....
He's unpredictable because you never know when he's going to shove a jolly rancher in your mouth!
By the way there was a missed chance for adding tension to the Batman vs. Superman fight since they went with that route. That is the tried-and-true approach of cutting to the literal clock that's running down. Imagine you're watching Superman lose the fight because Superman's an idiot, cutting to the time running out for Martha, back to fight, and such. But no. We see the villains setting up the clock. Next time we see that clock? the fight is over and Batman's beating the asses of the mercenaries. So freakin' dumb.