I disagree with the notion that "in the last year" refers to the last 12 months. Both your examples could refer to either a calendar year or the most recent 12-month period. In fact, there are many other definitions of "year", not only in English - the financial year, for example, is a fixed 12-month period that does not correspond to the calendar year. Context would have the greatest bearing on what a person meant by either "last year" or "in the last year".
"Last year" tends to refer to 12 months prior to the date in question. For example:
-"I got a bike for my birthday"
-"What did you get last year?"
One would get from this question that the person is asking about the same event under discussion (the birthday) 12 months ago. Of course, a birthday is a fixed date, but the same would be true of an event that was not fixed, for example:
-"This year I went to France for my vacation"
-"Where did you go on vacation last year?"
Although there is no fixed date for a vacation, this assumes that the person vacations every year and perhaps at approximately the same time of year. Without any further context, I think one would be reasonable in this assumption.
"In the last year" could mean "during the last 12 months" but it could equally mean "during the last calendar year". Context should determine what the benchmark is. For example, if someone were referring to data from a survey or census that was carried out annually it would be reasonable to assume that "last year" referred to the most recent complete period of that study. That could be a calendar year.
If somebody referred to something they did "last year" and they said this to you on January 1st you would assume that they were speaking about an event some 12 months ago, or at least some time ago within the last 12 months - it is unlikely you would think they were talking about something they did yesterday, even though that was technically "last year".
The only firm distinction between the two statements you quote is that saying "in the last year" specifically suggests that something happened either at any point during that period or throughout that period, rather than point to a specific time, for example:
Apple sold 216 million iPhones in the last year.
This makes it clear that 216 million iPhones were sold throughout the year. However:
Last year Apple sold 216 million iPhones.
This could mean that they sold that many all on the same day, although it is highly unlikely anyone would assume that was what it meant.
To be clear: I am not advocating that we all assume what a person means - if you don't understand the context, ask them!