@@IDENTITY and SCOPE_IDENTITY() will return the last inserted identity value in the current session but in different scenarios they can each return different values.
While both @@IDENTITY and SCOPE_IDENTITY return the last identity value generated in any table in the current session, SCOPE_IDENTITY() will return the value only within the current scope (a scope is a stored procedure, trigger, function, or batch) while @@IDENTITY is not limited to a specific scope.
For example, nested stored procedures or triggers are part of the current session, but not part of the current scope. A scope is limited to the stored procedure or function that is explicitly invoked. This is how the @@IDENTITY and SCOPE_IDENTITY() can return different value when executing same stored procedure.