Those two ways are used to concat files with the same codec.
Concat protocol
… works at the file level. → For files without a header, like MPEG-2 TS.
ffmpeg -i "concat:file1.ts|file2.ts|file3.ts" -c copy movie.mkv
Concat demuxer
… works at the stream level. → For files with a header, like MKV or MP4.
$ cat files.txt file 'file1.mkv' file 'file2.mkv' file 'file3.mkv' $ ffmpeg -f concat -i files.txt -c copy movie.mkv