Functions and stored procedures are not the same thing, or even close.
The really important difference is that functions cannot alter table data at all: SELECT is OK, but INSERT, UPDATE, and DELETE operations are forbidden.
The next most important is that you can use a Function in an SQL statement (even if that statement is inside a Stored Procedure) but you cannot use an SP inside a Function.
There are other differences, which are summarised here:
Difference between Stored Procedure and Function in SQL Server[
^]