Here is an example of Marching Squares. This sample animates as the algorithm steps through the grid to determine how much of a cell is inside and outside of the circle constraint.
The main idea is that each of the four corners of a cell is assigned a bit wise value, like 1,2,4,8 which then you sum those values which will to determine what to draw in that cell.
Once you sum up the corners that are active, that value is the index of some sort of array that contains our 16 possible ways to draw the cell. In the title image, the bottom left corner is the only active point, so we get a total value of 2. From there, we just look up in our array for the build instructions for 2.
When it comes to marching squares or its 3D version, Marching Cubes, how to draw a cell an be defined in any way that makes sense to your game/application. There are sets out that you can use that will draw specific things. In this example, its a very simple set where each possibility has a collection of mid points on edges to use. So for the title image, value 2 means to take the mid point of the left and bottom edge then draw a line between them. There is a set for marching cubes as well, which define 255 possible ways a cube can be used to determine where to draw 1 or more triangles within the constraint of that one cubic cell.