How the materials are worked out
Gate openings are subtracted from the fence length first, leaving the length that actually gets rails and pickets. That length is divided by the post spacing and rounded up to whole sections. A straight run needs one more post than it has sections, and each gate set into the line adds one more, because a gate opening needs a post on both sides. Rails are the number of sections times the rails per section. Pickets are the fenced length in inches divided by the picket width plus the gap, rounded up.
Concrete is worked out per hole: the volume of a round hole of the diameter and depth you enter, minus the square post standing in it. That is multiplied by the number of posts and divided by the yield of the bag size you pick, the same bag yields used by the concrete calculator.
The defaults are starting points
The calculator starts with posts every 8 feet, which matches the common 8 foot rail length. It assumes a 6 foot fence with 3 rails per section, 5.5 inch wide pickets butted together for privacy, 4x4 posts, and holes 10 inches wide and 24 inches deep. These are rules of thumb, not requirements. Frost depth, soil, wind and local codes can call for deeper holes, closer posts or bigger posts, so check with your local building department or follow your plan, and change the fields to match.
For a picket fence with spaces, enter the gap between pickets. For shadowbox or board-on-board styles, where pickets overlap on both sides of the rails, work out the pickets for one side by entering the gap, then double them.
Corners and separate runs
The calculator treats the fence as one straight run. Each corner that does not land exactly on a section break needs an extra post, and so does each end of a separate run, for example the two sides of a yard that do not join. Count those and add them to the post total. Gate posts often take a larger post or a deeper hole because they carry the weight of the gate.
What this does not cover
Gates themselves, post caps, hinges, latches, fasteners, gravel for drainage under the posts, and stain or sealer are separate items. Buy a few spare pickets to replace split or warped boards.