Interesting that this and abracadabra both have uncertain origins. This word seems to have more of a faux-Arabic sound to my ear, as if the original coinage was attempting to play upon the mysterious and mystic perception of the Middle East. The tendency to have people vary the end of the word while retaining the beginning also seems to argue in support of such an idea.
alakazam, int.
Used as an exclamation imparting supposed magical power, as when performing a trick. Hence in extended use, connoting any sudden transformation or happening. Cf. ABRACADABRA int.
In quot. 1902 as part of an extended magical formula.