Rozzski89,
Driving traffic to your site through banner ads is a popular way to bring targeted traffic to your site. To get to your questions.
1. There are different vendors that will allow you to place banner ads of many different sizes on targeted sites that pertain to your niche. One of the sites that I use quite often, but have had mixed results with, is the BuySellAds site. This site has a large groups of sites, broken down by niche that lists ad sizes and process both on a fixed rate and a pay per click rate. They have a decent tracking tool that allows you to see ow many clicks your ad is receiving and allows for A and B ads for comparison. Again they have a pretty good offering but I have had mixed results with the performance of those ads. There are other vendors that offer this same service but the one that I have mentioned is one of the more reputable ones that I have used.
2. What I have done more often is when I find a site that I want to advertise on I will contact the site admin and arrange to have an ad placed on the site. This normally takes a little negotiating on size and price but that is all part of doing business. Once I have the ad approved I will create a unique URL for that ad that will be placed with the ad when it is added to the site. The URL will have a unique ID that will only be used with that particular ad.
Using PHP I will capture that unique ID when the ad is clicked and the click is routed to the site. Once the click is captured I will gather a group of data from that click, this data is normally stored in the meta data of the packets being forwarded to the site, and write that information into a database. Then using an admin panel that I have written in PHP, HTML and CSS I can present that data in numerous ways based on the requirement that I have or the requirements that the customer has requested I track.
I do this all the time for both my sites and customer sites that I develop and maintain.
This may sound a little complicated, but really anyone that is good with PHP, HTML and CSS this is a pretty simple process.
I hope this answers your question.