how does the program know what it is starting with?
Short answer.....It doesn't know.
You have to tell it where to cut. It does not know, or even care, if the cuts are in a pipe, a solid rod, a square piece of wax, or a human finger.
To put it in basic terms, what you normally do is determine a point on your tube to reference everything else to. Lets say the far left end of the pipe, bar, block, is X axis zero. the center of the part is Y axis zero, and the top of the part is Z axis zero. All of your features would be referenced from these points. You can input the proper G-code manually, or you can take your cad drawing, and import it into a cam program to make tool paths. Most cam programs have basic cad functions, and sometimes its just easier to do the cad portion in the cam program. Anyhow.....you, or a cam program has to tell the machine where to cut, because it has no idea without instructions. You might think of it like instructing a blind person how to navigate an obstacle course. They don't know what the obstacles are, or even care, there just going to step where you tell them to.
don't I have to tell the program the starting dimensions of the block so it knows what has to be cut away
nope. You have to tell the cam program the dimensions of the block so that IT can make a proper tool path to instruct Mach what to cut.
If all your wanting is simple slots and holes, the wizards that come with mach should suffice just fine. No need for an expensive cam program. You could even program them in manually without much effort. If you get that A axis, and start doing complex cuts, your most likely going to need some cam software.
P.S. we are all dumb newbs at some point.