If the text cursor is inside a foldable range (as indicated in the left margin), the Toggle Fold command in the Fold menu unfolds the foldable range if it was folded, and folds it if it wasn’t folded. This is the same as clicking the folding icon in the left margin.
If the text cursor is not inside a foldable range, and some text is selected, the Toggle Fold command folds the selected text by creating a new folding range, just like the Fold command in the Fold menu does.