What most historians say is that Italy turned away from an alliance with Germany and Austria-Hungary and toward an alliance with France and Great Britain out of greed. The Italians claimed that the change was due to the fact that the Germans and Austria-Hungary had been unfair to the Serbs. But historians say that this was not the real reason.
Before the Italians switched sides, the British, French and Russians made a secret treaty with them. The basic idea of this treaty was that the Italians would get a lot of new territory. Specifically, the Italians were going to be given (if they joined the Allied side) a lot of territory that they wanted but which currently belonged to Austria-Hungary.