To celebrate my 3 month probation as a web developer concluding, I'm going to make a terminal cake for the office. In my research on the subject I came across this photo, and was wondering what the commands do?

To celebrate my 3 month probation as a web developer concluding, I'm going to make a terminal cake for the office. In my research on the subject I came across this photo, and was wondering what the commands do?

That pipeline tries to stop all of the Apache processes on the system, in a rather heavy-handed Rube Goldbergian fashion.
The pipeline:
Gets a list of all processes on the system. (ps axww)
This method is an overreach, providing more data than is actually necessary to achieve the desired end, which will cause problems later.
Looks for lines containing httpd, which is a common process name for the Apache web server. It could match other things accidentally, but on a machine that's supposed to just be a web server, it's fairly safe.
You get lines like this out of this stage:
17652 ? Ss 0:00 /usr/bin/httpd -blah -args
The pipeline would match a vi /etc/httpd/conf.d/mime.conf command, too.
Filters out lines containing grep (grep -v grep) because the first grep will also find itself:
24180 pts/0 R+ 0:00 grep httpd
If you don't filter this line out, you risk killing off the first grep instance before the pipeline finishes, thereby breaking the pipeline. ps on Linux sorts its output by PID by default, so since PIDs wrap around, grep could appear before httpd, causing the cake command to actually have no effect at all.
Uses xargs to run kill -9 on every line found.
That is, it builds commands like this and runs them:
kill -9 17652 ? Ss 0:00 /usr/bin/httpd -blah -args
This may or may not do what you want. It can sometimes work because the process ID (PID) is the first thing on the line when you run ps with the axww flags. (There are other ways to run ps where the first thing on the line is something else.) The cake decorator is hoping that the implementation of kill on the system doesn't barf when it gets all the other junk following the PID on the ps output line.
POSIX doesn't say what kill(1) does with non-PID arguments. It could stop at the first non-numeric argument, it could give errors for each such argument it finds, or it could silently ignore them. If the line found by ps happens to contain numbers that are valid PIDs, the command on the cake could end up killing processes you didn't intend it to.
It would be a lot better to use pgrep here, if it's available:
# pgrep httpd | xargs kill -9
Not only is the command shorter, it does what you actually want, reliably. It doesn't match and then filter out grep processes, it only matches on the process name, and it doesn't pass non-PID junk to kill.
Systems with pgrep often also have the command pkill, which wraps up that pipeline into a single command:
# pkill httpd
You can add -9 here to forcibly terminate httpd processes if you want, but I will leave it off from here on. I've ordered these commands to be increasingly discriminate, so it also makes sense to make them decreasingly brutal, if you will.
If your system doesn't have pgrep or pkill, it may have pidof:
# kill $(pidof httpd)
Yet another method is to use killall:
# killall httpd
Beware, the killall command may do something different on non-Linux OSes.
The safest method is to use your OS's normal "stop the web server" command, however. Examples:
# service httpd stop
# /etc/init.d/httpd stop
# systemctl stop httpd.service
# launchctl unload /System/Library/LaunchDaemons/org.apache.httpd.plist
Apache includes a "stop Apache nicely" command:
# apachectl stop
That command will only stop Apache proper, however. The OS-specific commands above may do other cleanup actions as well. If Apache was started by the OS, you should use the OS's own command to stop it, too.
This is a cake-protection command. This command unables a Root to eat the cake, because after this angry users will call the Root, open trouble tickets, etc. :)