Re the fencing, depends on your crops and your critters. EVERY critter in the world (apparently) loves tomatoes and corn, if you grow that. I don't grow corn, partly because of the critter problem, but I do grow tomatoes. So I put stakes around the edge of the bed(s) the tomatoes are in, and wrap it with deer netting (also called bird netting). Fasten it down at the bottom AND pull it together over the top and fasten it, so the tomatoes are in a complete cage.
Since I have lots of birds, squirrels, raccoons, groundhogs, possums, etc, if I didn't do that I would never get a tomato. Broccoli isn't eaten by quite as many critters, but the groundhogs do love it. That's another reason that it works for me to plant broccoli in the same bed where the tomatoes will (later) go, so they can share the same fencing.
On the other hand, my green peppers as well as all the herbs, I don't bother fencing, because nothing bothers them.
If you have fewer critters around your place, fencing may not be as important.
Re your original question on materials, I started out with railroad ties, some of my flower beds just have plastic edging, but a lot of my beds are done with stacked 4x4 pine fence posts. The fence posts are cheap (usually cheaper than the landscape timbers that are sold for the purpose) and they last forever. The posts last much longer than using boards, which is un-recommended, unless you use the recycled plastic boards (which would last even longer and provide a market for recycled plastic, but are expensive). The first beds I ever made, I made out of 1x12" boards with angle braces, but they fell apart and rotted out after just a few years. The first beds I made with the fence posts have been through ten seasons now and are going strong.