the expression comes from formal meetings where a motion is moved by someone to do something, and that motion is seconded by another person - effectively, they have to agree with the idea being put forward, before it will be considered by the committee or put to the whole membership for a vote. In casual usage, if someone says something that you wholeheartedly agree with, you can say "I second that".