Hello. Word is really confusing when it comes to formatting.
Keep lines together will apply to lines within a paragraph. But keep with next is meant to create that behavior between line breaks. For example, selecting a paragraph and selecting "keep lines together" will prevent it from being broken at a page break. But if that leaves the heading alone on the previous page, you can then select the heading and select "keep with next". Almost the same thing, except keep lines together applies only to paragraphs.
Let me know if you still have questions.