Does anybody know how they got the little yellow lines indicating "chapters" in this YouTube video?
As mentioned in the comments, those chapter markers aren't chapter markers but ad break markers. Ad breaks are only available on videos longer than 10 minutes, and can be placed either automatically or manually.
Putting ads in places where a new chapter or sequence begins makes sense of course (as opposed to putting one mid-sentence), so those ad-markers do double as chapter markers as well.
While those are indeed ad break markers in the screenshot of the question, the answer is:
You can create chapter markers for a YouTube video by adding timestamps and some verbiage to the video description.
Take this video for example: https://www.youtube.com/watch?v=ckYN_TwbGiQ&t=194s
You can see that the play bar is broken up into segments, each segment being functionally equivalent to a chapter.
Below, in the description, are the aforementioned timestamps. The format is
[h:m:s] Freeform text[CRLF]
wherein h:m:s is hours, minutes, and seconds. Hours may be omitted if the timestamp is less than one hour into the video, and the hours and minutes may or may not be zero-padded, at your preference.
For example, this video description should create chapter markers in a hypothetical 10 minute video:
This is my awesome video, please comment and share!
1:45 Meet my Cat
5:22 I Eat Spaghetti
9:32 Time for Swimming or Whatever
Note that in the example pictured, the text Video Markers; appears atop the list of chapters. That's not necessary, and nothing need precede the list.
(This is poorly documented, and not used very often. It worked on the video pictured and I verified all of this using a video on my YouTube account. I can't guarantee that it will work on all accounts, and YouTube has a tendency to dole out features depending upon account status.)
YouTube has a guideline for adding chapters to videos.
BUT. This feature doesn't work for many people as you can see in the comment section under the video from the guideline. Some say it stopped working, some say it works only when it wants to.