They are work hand in hand.
By fine tuning the speed of the website the files on the website like scripts and themes (style sheets/css) are being optimized as well. This will usually mean that they are getting enhanced security and updates in the process.
Having a nice looking website is important but having a secure site that loads fast and that is a step ahead of your competition is vital to having the strategic edge in this competitive market place.
An effective website performance process can be 100s of steps long and take months to accomplish.
On a basic site it can be done in as little as a day if everything is in place to have the work done.
Don’t let these things get overlooked or put off for too long. They should be done during the development process so that the same steps don’t have to be done more than once.