Because there are more vertices in a rectangle than a triangle.
A triangular prism has 6 vertices, and a triangular pyramid has 4 vertices, so a triangular prism has 2 more vertices than a triangular pyramid.
Both have 4 vertices, though he vertices of a square are 2 dimensional vertices while those of a triangular pyramid are 3-d.
A cube has 8 vertices, a triangular pyramid has 4. So there are 4 more.
A triangular prism has 6 vertices and a triangular pyramid has 4 vertices. .