if line 11 confuses you, you need to read this first.
https://cplusplus.com/doc/tutorial/pointers/
and this as well:
https://cplusplus.com/doc/tutorial/dynamic/
note that NULL has been replaced by nullptr in modern code.
once you have a handle on the syntax from the 2 articles, you will see what most of this is doing, but in short...
push makes a new item and attaches it to the front of the list.
so the list starts out empty, equal to null, and say we are adding integers, it looks like this
null
(push 3)
3 - null
push 2
2 - 3 - null
and null will be used to realize you hit the end of the list.
pop will do the reverse, if there is something not null on the list, it removes the first one, so
2 - 3 - null
removes 2 giving
3 - null and the 2 is returned to the user to be consumed.
display just shows everything in your stack, and is an example of using null to stop iterating and realize its the end of the list. Most lists also have a peek to see the top value without removing it.