A stored procedure is stored in the "database schema" by itself (it is not on any "outside" program). What you read is correct : see it like a way to ease your work.
For example, if you have a table to store the details of an order "ORDERS" (order number, detail (product A, product B)), another table for the prices "PRICES" ([product A, price A],[product B, prince B]), you can imagine storing in another table only the total price of the orders "TOTALS" (order numbers, total of the order).
So when the data is inserted in "ORDERS" you immediately get the total in "TOTALS". Doing like this is quicker and easier (but you could have of course inserted the sums by yourself in the "TOTALS" table). It grants not to change the sum of an order even if the prices of product A or B changed (but this is by design, other methods could have done the same result of course).
About archieving : if you have a column with a timestamp. You can for example "clear" rows after an interval each time you add new data to a table. You can make backups, etc, etc