There's 2 thing in your question.
First if you consider a single vlan, the port 6 being a trunk is not mandatory, setting the port 6 of both switch as VLAN3 will work.
A trunk port has interest when you have multiples vlan on a switch, this mean you have made partitions on your switch, port 1 to 5 on VLAN3, port 7 to 12 on VLAN 4 for example, and you configure your port 6 as trunk to transport vlan 3 and 4. You may achieve the same thing without a trunk port if you keep port 6 in vlan 3 and use port 12 in VLAN 4 to link the two switches for example.
A switch records incoming mac address on a port, such that when a packet is directed to a mac address it know where to send it, when it don't know or if it's a broadcast it send it on all ports within the same vlan, trunk included and the switch receiving the packet will scan it's own table before forwarding the packet to the correct port if already know or on all port within the vlan if the mac address is unknown or broadcast.
Mainly a vlan is a virtual switch within the switch and the trunk is an aggregation of "virtual ports" to transport multiple vlans on a single link (trunk on multiple links are trunks made on port aggregation (LACP) and are another subject).