In the last year, last year, in the past year
How do such things come into being? We may assume that the beginnings were something like this: When was it? - That was in the last year. Then you may assume that this was shortened to: That was last year. The omission of self-evident "in" does not change the meaning.
Then "last year" alone can be used as an adverbial group in a sentence.
So "Last year we went to Italy" will be the most frequent formula, simply because it is the shortest indication of "when".
Of course you can use the longer formula "In the last year we went to Italy." There is no difference of meaning at all. It is only longer, and an author may use it simply for rhythmic and stylistic reasons. You may also use it in spoken language, for example when you need some time to formulate what you want to say.
But we can say when there is a short formula then it is the short formula that is most frequently used.
In the past year: The idea is exactly the same. It is simply a different "picture".
When you say "the last year" you think of a row of things and you choose the thing at the end.
When you say "the past year" you think that an event has gone by or passed.
If I would look at Google N-gram Viewer, I think, that "in the past year" is less common than "last year". I would say it is a variant that can be found occasionally.